using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter16
{
	/// <summary>
	/// Example05: Rescuing the Hiker
	/// An 80 kg hiker is trapped on a mountain ledge following
	/// a storm. A helicopter rescues the hiker by hovering above
	/// him and lowering a cable to him. The mass of the cable is
	/// 8 kg, and its length is 15 m. A chair of mass 70 kg is attached
	/// to the end of the cable. The hiker attaches himself to the
	/// chair, and the helicopter then accelerates upward. 
	/// Terrified by hanging from the cable in midair, the hiker
	/// tries to signal the pilot by sending transverse pulses
	/// up the cable. A pulse takes 0.25 s to travel the length
	/// of the cable. What is the acceleration of the helicopter?
	/// a = 3 m/s^2
	/// </summary>
	public class Example05
	{
		public Example05()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Time t = new L.Time();
			t.s = 0.25;
			L.Length l = new L.Length();
			l.m = 15.0;
			L.Speed v = new L.Speed();
			v.mPERs = l.m/t.s;
			L.Mass m = new L.Mass();
			m.kg = 8.0;
			L.Mass mcpm = new L.Mass();
			mcpm.kg = 80.0+70.0;
			L.Force T = new L.Force();
			T.Z = m.kg/l.m*v.mPERs*v.mPERs;
			double a = T.N/mcpm.kg-L.Constant.AccelerationOfGravity;
			result += Convert.ToString(a);      
		}
	}
}
